﻿using UnityEngine;
using System.Collections;

public abstract class Localization  {

	public static string language = PlayerPrefs.GetString("language");
	string play;
	public abstract string Play 
	{
		get;
	}
	string settings;
	public abstract string Settings 
	{
		get;
	}
	string back;
	public abstract string Back 
	{
		get;
	}
	string welcome;
	public abstract string Welcome 
	{
		get;
	}

	private static Localization instance_CN = new Localization_CN();
	private static Localization instance_EN = new Localization_EN();
	public static Localization Instance
	{
		get
		{
			switch(language)
			{
			case "Chinese":
				return instance_CN;
			case "English":
				return instance_EN;
			default:
				return instance_EN;
			}
		}
	}




}
public class Localization_CN :Localization
{
	string play = "开始游戏";
	public override string Play 
	{
		get
		{
			return play;
		}
	}
	string settings = "设置";
	public override string Settings 
	{
		get
		{
			return settings;
		}
	}
	string back = "返回";
	public override string Back 
	{
		get
		{
			return back;
		}
	}
	string welcome = "欢迎来到第二个页面";
	public override string Welcome 
	{
		get
		{
			return welcome;
		}
	}

}

public class Localization_EN :Localization
{
	string play = "PLAY";
	public override string Play 
	{
		get
		{
			return play;
		}
	}
	string settings = "SETTINGS";
	public override string Settings 
	{
		get
		{
			return settings;
		}
	}
	string back = "BACK";
	public override string Back 
	{
		get
		{
			return back;
		}
	}
	string welcome = "welcome to the second page";
	public override string Welcome 
	{
		get
		{
			return welcome;
		}
	}
}
